using System;
using System.Collections.Generic;
using System.Text;

using PickGold;
using PickGold.Database;
using PickGold.Entities.Table;

namespace PickGold.Entities.View
{
    public abstract partial class CRadixNewsInfo : CBaseView
    {
        //
		// tb_sys_news_info
		public const string SURA_ID = CBaseSuraInfo.ENTITY_KEY;
		public const string USER_ID = CBaseUserInfo.ENTITY_KEY;
		public const string ROLE_ID = CBaseRoleInfo.ENTITY_KEY;
		public const string COM_ID = CBaseCompanyInfo.ENTITY_KEY;
		public const string USER_AUDIT = "user_audit";
		public const string MIME_ID = CBaseMimeInfo.ENTITY_KEY;
		public const string FILE_ID = CBaseFileInfo.ENTITY_KEY;
		public const string ITEM_VALUE = "item_value";
		public const string ITEM_ORIGIN = "item_origin";
		public const string ITEM_REVERT = "item_revert";
		public const string ITEM_REVIEW = "item_review";
		public const string ITEM_CREATE = "item_create";
		public const string ITEM_AUDIT = "item_audit";
		//
		public const string SURA_NAME = CBaseSuraInfo.ENTITY_SYMBOL;
		public const string SURA_PATH = "sura_path";
		public const string USER_NAME = CBaseUserInfo.ENTITY_SYMBOL;
		public const string ROLE_NAME = CBaseRoleInfo.ENTITY_SYMBOL;
		public const string COM_NAME = CBaseCompanyInfo.ENTITY_SYMBOL;
		public const string FILE_MIME = "file_mime";
		public const string FILE_NAME = CBaseFileInfo.ENTITY_SYMBOL;
		//
        private SRadixNewsInfo _ = null;
        //
        public CRadixNewsInfo(string name) : base(name) { }
        public CRadixNewsInfo(string name, string alias) : base(name, alias) { }
        public CRadixNewsInfo(CDatabase db, string name) : base(db, name) { }
        public CRadixNewsInfo(CDatabase db, string name, string alias) : base(db, name, alias) { }
        //
        protected override void SetSchema()
        {
            this.SetSchema(new SRadixNewsInfo());
        }
        protected void SetSchema(SRadixNewsInfo s)
        {
            this._ = s;
            base.SetSchema(s);
        }
        //
        protected override void PreInitSchema()
        {
            base.PreInitSchema();
			// tb_sys_news_info
			this._DataTable.Columns.Add(SURA_ID, typeof(long)).DefaultValue = this._.SuraID;
			this._DataTable.Columns.Add(USER_ID, typeof(long)).DefaultValue = this._.UserID;
			this._DataTable.Columns.Add(ROLE_ID, typeof(long)).DefaultValue = this._.RoleID;
			this._DataTable.Columns.Add(COM_ID, typeof(long)).DefaultValue = this._.ComID;
			this._DataTable.Columns.Add(USER_AUDIT, typeof(long)).DefaultValue = this._.UserAudit;
			this._DataTable.Columns.Add(MIME_ID, typeof(long)).DefaultValue = this._.MimeID;
			this._DataTable.Columns.Add(FILE_ID, typeof(long)).DefaultValue = this._.FileID;
			this._DataTable.Columns.Add(ITEM_VALUE, typeof(string)).MaxLength = 8000;
			this._DataTable.Columns.Add(ITEM_ORIGIN, typeof(string)).MaxLength = 256;
			this._DataTable.Columns.Add(ITEM_REVERT, typeof(int)).DefaultValue = this._.ItemRevert;
			this._DataTable.Columns.Add(ITEM_REVIEW, typeof(int)).DefaultValue = this._.ItemReview;
			this._DataTable.Columns.Add(ITEM_CREATE, typeof(DateTime)).DefaultValue = this._.ItemCreate;
			this._DataTable.Columns.Add(ITEM_AUDIT, typeof(DateTime)).DefaultValue = this._.ItemAudit;
		}
        //
		#region Property
		//
		#region tb_sys_news_info

		//
		[CForeignLink(typeof(CBaseSuraInfo))]
		public long SuraID
		{
			set
			{
				this._.SuraID = value;
				this.SetValue(SURA_ID, value);
			}
			get
			{
				return this._.SuraID;
			}
		}

		//
		[CForeignLink(typeof(CBaseUserInfo))]
		public long UserID
		{
			set
			{
				this._.UserID = value;
				this.SetValue(USER_ID, value);
			}
			get
			{
				return this._.UserID;
			}
		}

		//
		[CForeignLink(typeof(CBaseRoleInfo))]
		public long RoleID
		{
			set
			{
				this._.RoleID = value;
				this.SetValue(ROLE_ID, value);
			}
			get
			{
				return this._.RoleID;
			}
		}

		//
		[CForeignLink(typeof(CBaseCompanyInfo))]
		public long ComID
		{
			set
			{
				this._.ComID = value;
				this.SetValue(COM_ID, value);
			}
			get
			{
				return this._.ComID;
			}
		}

		//
		[CForeignLink(typeof(CBaseUserInfo))]
		public long UserAudit
		{
			set
			{
				this._.UserAudit = value;
				this.SetValue(USER_AUDIT, value);
			}
			get
			{
				return this._.UserAudit;
			}
		}

		//
		[CForeignLink(typeof(CBaseMimeInfo))]
		public long MimeID
		{
			set
			{
				this._.MimeID = value;
				this.SetValue(MIME_ID, value);
			}
			get
			{
				return this._.MimeID;
			}
		}

		//
		[CForeignLink(typeof(CBaseFileInfo))]
		public long FileID
		{
			set
			{
				this._.FileID = value;
				this.SetValue(FILE_ID, value);
			}
			get
			{
				return this._.FileID;
			}
		}
		//
		public string ItemValue
		{
			set
			{
				this._.ItemValue = value;
				this.SetValue(ITEM_VALUE, value);
			}
			get
			{
				return this._.ItemValue;
			}
		}
		//
		public string ItemOrigin
		{
			set
			{
				this._.ItemOrigin = value;
				this.SetValue(ITEM_ORIGIN, value);
			}
			get
			{
				return this._.ItemOrigin;
			}
		}
		//
		public int ItemRevert
		{
			set
			{
				this._.ItemRevert = value;
				this.SetValue(ITEM_REVERT, value);
			}
			get
			{
				return this._.ItemRevert;
			}
		}
		//
		public int ItemReview
		{
			set
			{
				this._.ItemReview = value;
				this.SetValue(ITEM_REVIEW, value);
			}
			get
			{
				return this._.ItemReview;
			}
		}
		//
		public DateTime ItemCreate
		{
			set
			{
				this._.ItemCreate = value;
				this.SetValue(ITEM_CREATE, value);
			}
			get
			{
				return this._.ItemCreate;
			}
		}
		//
		public DateTime ItemAudit
		{
			set
			{
				this._.ItemAudit = value;
				this.SetValue(ITEM_AUDIT, value);
			}
			get
			{
				return this._.ItemAudit;
			}
		}
		//
		#endregion
		//
		#endregion
		//
        public override bool MoveTo(int position)
        {
            if (!base.MoveTo(position))
                return false;

			// tb_sys_news_info
			this._.SuraID = this.GetValue<long>(SURA_ID);
			this._.UserID = this.GetValue<long>(USER_ID);
			this._.RoleID = this.GetValue<long>(ROLE_ID, true);
			this._.ComID = this.GetValue<long>(COM_ID, true);
			this._.UserAudit = this.GetValue<long>(USER_AUDIT, true);
			this._.MimeID = this.GetValue<long>(MIME_ID, true);
			this._.FileID = this.GetValue<long>(FILE_ID, true);
			this._.ItemValue = this.GetValue<string>(ITEM_VALUE, true);
			this._.ItemOrigin = this.GetValue<string>(ITEM_ORIGIN, true);
			this._.ItemCreate = this.GetValue<DateTime>(ITEM_CREATE);
			this._.ItemAudit = this.GetValue<DateTime>(ITEM_AUDIT, true);

			return true;
        }
        //
    }
    //
    public class SRadixNewsInfo : SBaseView
    {
		// tb_sys_news_info
		public long SuraID = -1;
		public long UserID = -1;
		public long RoleID = -1;
		public long ComID = -1;
		public long UserAudit = -1;
		public long MimeID = -1;
		public long FileID = -1;
		public string ItemValue = null;
		public string ItemOrigin = null;
		public int ItemRevert = 0;
		public int ItemReview = 0;
		public DateTime ItemCreate = DateTime.MinValue;
		public DateTime ItemAudit = DateTime.MinValue;
		//
    }
    //
}
//
